<template>
  <!-- <div class="content-box">
  <common-header :title="title" :showleft="false"></common-header>-->
  <div class="page-content">
    <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
      <div class="cell">
        <van-skeleton :row="3" style="background:#fff" v-if="isshow" />
        <cellList :titleList="titleList" />
      </div>
      <commonFooter></commonFooter>
    </van-pull-refresh>
  </div>
  <!-- </div> -->
</template>

<script>
import { newsApi } from "@/api";
import { commonFooter, cellList } from "common";
export default {
  data() {
    return {
      title: "帮助中心",
      num: 0,
      isLoading: false,
      isshow: true,
      titleList: [
        // { title: "测试新增单页", id: 1 },
        // { title: "我要赚钱文案", id: 2 },
        // { title: "福利活动", id: 3 },
        // { title: "平台公告", children: [] },
        // { title: "APP下载" },
        // { title: "公司简介" },
        // { title: "安全保障" },
        // { title: "收益模式" },
        // { title: "常见问题" },
        // { title: "会员等级" },
        // { title: "支付方式" },
        // { title: "公司资质" },
        // { title: "联系我们" }
      ]
    };
  },
  // beforeRouteLeave(to, from, next) {
  //   //去编辑页不缓存
  //   to.meta.keepAlive = false;
  //   next();
  // },
  // created() {},
  created() {
    this.getNews();
  },
  methods: {
    async onRefresh() {
      await this.getNews();
      this.isLoading = false;
    },
    getNews() {
      return newsApi({pid:0}).then(res => {
        if (res.code == 200) {
          this.titleList = res.data;
          this.isshow = false;
        }
      });
    }
  },
  components: {
    commonFooter,
    cellList
  },
  computed: {}
};
</script>

<!-- Add 'scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
@import "~styles/index.less";
.page-content {
  .mb(98);
}
.cell {
  // margin: 0.5rem 0.2rem;
  /deep/ li {
    border-bottom: 1px solid #eee;
  }
}

/deep/ .van-skeleton__row {
  margin: 12px;
  height: 32px;
  width: calc(100% - 24px) !important;
}
</style>
